package com.yq.controller.system;

import com.yq.servicce.DictDataService;
import com.yq.vo.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: yangQ
 * @Date: 2020/11/24 19:58
 * @Description:
 */
@RestController
@RequestMapping("system/dict/data")
public class DictDataController {
    @Autowired
    private DictDataService dictDataService;

    /**
     * 根据字典类型查询字典数据
     * @param dictType
     * @return
     */
    @GetMapping("getDataByType/{dictType}")
    public AjaxResult getDataByType(@PathVariable @Validated  String dictType){
        return AjaxResult.success(this.dictDataService.selectDictDataByDictType(dictType));
    }
}
